<template>
  <h2 v-if="Math.random() > 0.5">Math.random()&gt;0.5</h2>
  <h2 v-else>Math.random()&lt;=0.5</h2>

  <hr />
  等级：<select v-model="type">
    <option value="">--请选择--</option>
    <option value="A">A</option>
    <option value="B">B</option>
    <option value="C">C</option>
    <option value="D">D</option>
  </select>
  type={{ type }}

  <h2 v-if="type === ''">请选择等级</h2>
  <template v-else-if="type === 'A'">优秀</template>
  <h2 v-else-if="type === 'B'">良好</h2>
  <h2 v-else-if="type === 'C'">合格</h2>
  <h2 v-else>合格</h2>
</template>

<script lang="ts">
import { ref } from "vue";
export default {
  setup() {
    let type = ref("");
    return { type };
  },
};
</script>
<style scoped></style>
